<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // html5 新增属性
        // localStorage 1.长久储存 浏览器刷新关闭无影响
        //sessionStorage1.临时储存  浏览器关闭消失


    // localStorage.setItem("name", "张三")
    // localStorage.name2 = "李四"
     //删除单个
    //  localStorage.removeItem("name2")
    //全部删除
    // localStorage.clear()




 //    var arr=[1,2,3]
//    //JSON.stringify转换成字符串
//    localStorage.arr=JSON.stringify(arr)
// //   JSON.parse转换成复杂数据类型
//   console.log(JSON.parse(localStorage.arr));   



    //sessionStorage临时存储
    // sessionStorage.name="张三"
    // console.log(sessionStorage.name);
    </script>
</body>

</html>